#ifndef OUTPUTSETTINGS_H
#define OUTPUTSETTINGS_H

#include <QString>
#include <QFont>
#include <QColor>

// 页眉页脚位置枚举
enum class HeaderFooterPosition {
    Left,
    Center,
    Right
};

// 页眉页脚设置
struct HeaderFooterSettings {
    bool enabled = false;
    QString text;
    QFont font = QFont("Arial", 12);
    QColor color = Qt::black;
    HeaderFooterPosition position = HeaderFooterPosition::Center;
    bool showOnCoverPage = false;
    
    HeaderFooterSettings() = default;
};

// 封面页设置
struct CoverPageSettings {
    bool enabled = false;
    QString title;
    QString subtitle;
    QString author;
    QString date;
    QFont titleFont = QFont("Arial", 24, QFont::Bold);
    QFont subtitleFont = QFont("Arial", 18);
    QFont authorFont = QFont("Arial", 14);
    QFont dateFont = QFont("Arial", 12);
    QString templateName = "默认模板";
    
    CoverPageSettings() = default;
};

// 页边距设置（单位：毫米）
struct MarginSettings {
    double top = 20.0;
    double bottom = 20.0;
    double left = 20.0;
    double right = 20.0;
    
    MarginSettings() = default;
};

// 完整的输出设置
struct OutputSettings {
    MarginSettings margins;
    HeaderFooterSettings header;
    HeaderFooterSettings footer;
    CoverPageSettings coverPage;
    QString templateName = "默认设置";
    
    OutputSettings() = default;
    
    // 序列化支持
    QString toJsonString() const;
    bool fromJsonString(const QString& json);
};

#endif // OUTPUTSETTINGS_H
